using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace SimpleFramework
{
    public static class ResActivator
    {
        public const long INVALID_INDEX = -1;
        private static long UUID_INDEX = 0;
        private static HashSet<long> UUID_ACTIVE_LIST = new HashSet<long>();

        public static long NewUUID()
        {
            long index = UUID_INDEX++;
            if (index == INVALID_INDEX)
                index = UUID_INDEX++;
            return index;
        }

        public static void SetActive(long uuid, bool enable)
        {
            if (enable)
            {
                UUID_ACTIVE_LIST.Add(uuid);
            }
            else
            {
                UUID_ACTIVE_LIST.Remove(uuid);
            }
        }

        public static bool IsActive(long uuid)
        {
            return UUID_ACTIVE_LIST.Contains(uuid);
        }
    }
}